﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.eforceglobal.crux.DTOs.Configuration;

namespace com.eforceglobal.crux.exceptions
{
    public class CruxException : Exception
    {
        public CruxException(string Message) : base(Message)
        {
        }

        public CruxException(string Message, string ErrorCode) : base(Message)
        {
            this.ErrorNameOrCode = ErrorCode;
            this.Description = Message;
            ErrorInformation errorInformation = CruxApplicationErrorManager.GetApplicationError(ErrorCode);
            this.ShortDescription = errorInformation.ShortDescription;
            this.ProbableCause = errorInformation.ProbableCause;
            this.RecommendedAction = errorInformation.RecommendedAction;
        }


        private string _ErrorNameOrCode = "";

        public string ErrorNameOrCode
        {
          get { return _ErrorNameOrCode; }
          set { _ErrorNameOrCode = value; }
        }

        private string _Description = "";

        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }

        private string _ShortDescription = "";

        public string ShortDescription
        {
            get { return _ShortDescription; }
            set { _ShortDescription = value; }
        }
        private string _ProbableCause = "";

        public string ProbableCause
        {
            get { return _ProbableCause; }
            set { _ProbableCause = value; }
        }
        private string _RecommendedAction = "";

        public string RecommendedAction
        {
            get { return _RecommendedAction; }
            set { _RecommendedAction = value; }
        }

    }
   
}
